<?PHP
namespace DB // Persistence layer
{
   class Table
   {
      private static $dbClient;
	  
	  public static function init($dbType)
	  {
	     global $dbUserName;
		 global $dbPassword;
		 global $dbInfo;
		 
	     switch($dbType)
		 {
		    case "oracle":
                static::$dbClient = new Oracle($dbUserName, $dbPassword, $dbInfo);
            break;
            case "sqlite":
                static::$dbClient = new Sqlite($dbUserName, $dbPassword, $dbInfo);
            break;
		 }
	  }
   
      public static function Select($query, $args)
      {
         $res = static::$dbClient->query($query, $args);
		 
		 return $res;
      }

      public static function NewRecord()
      {
         return NULL;
      }

      public static function Update($id, $field)
      {
         return 0;
      }
   }
   
   Table::init($dbType);
}